<?php require_once 'header.php';?>    <!-- DataTables Responsive CSS -->
    <link href="sb2/vendor/datatables-responsive/dataTables.responsive.css" rel="stylesheet">
	
        <!-- Page Content -->
        <div id="page-wrapper">
            <div class="container-fluid">
                <div class="row">
                <div class="col-lg-12">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                        	<?php echo XXF_BACK?>
                            学员详细列表：<span class="xxf_red">{{$pname}}</span> 
                            <?php if($result){?>
                            <table>
								<tr>
									<td>成绩上传 <a href="pxy_list/type/pxchengjitemp" target="_blank"><u>模板</u></a>=></td><td><input type="file" id="upchengji"></td>
									<td>照片上传=></td><td><input type="file" id="uppic"></td>
								</tr>
							</table>
                            	下载[
                            	<a href="pxy_down/ptype/1/pid/{{$pid}}" target="_blank">总表</a> |  
                            	<a href="pxy_down/ptype/2/pid/{{$pid}}" target="_blank">(主要负责人{{$zyfzr}})</a> | 
                            	<a href="pxy_down/ptype/3/pid/{{$pid}}" target="_blank">(安全管理人员{{$aqglry}})</a> 上报信息
                            	] 
                            	[
                            	<a href="pxy_down/type/1/pid/{{$pid}}" target="_blank">考核登记表</a>
                            	]
                            	[
                            	<a href="pxy_down/type/2/pid/{{$pid}}" target="_blank">班级档案表</a>
                            	]
                            <?php }?>
                        </div>
                        <!-- /.panel-heading -->
                        <div class="panel-body">
                            <table width="100%" class="table table-striped table-bordered table-hover" id="dataTables-example">
                                <thead>
                                    <tr>
                                        <th>序号</th>
                                        <th>图片</th>
                                        <th>姓名</th>
                                        <th>手机</th>
                                        <th>成绩</th>
                                        <th>人员类型</th>
                                        <th>年龄</th>
                                        <th>身份证</th>
                                        <th>单位名称</th>
                                        <th>备注</th>
                                        <th>操作</th>
                                    </tr>
                                </thead>
                                <tbody>
                                	<?php
                                	$i=0;
                                	foreach ($result as $row){$i++;
                                	?>
                                    <tr class="<?php echo $i%2==0?"even":"odd";?> gradeA" id='<?php echo $row['id'];?>'>
                                    	<td><?php echo $i;?></td>
                                    	<td><?php if(file_exists("uploader/xueyuanimg/".$row['idcard'].".jpg")){?><img src="uploader/xueyuanimg/<?php echo $row['idcard'];?>.jpg" width="50px;" height="60px;"><?php }else {echo '无';}?></td>
                                    	<td><a href="syspxserch/puid/<?php echo $row['id'];?>"><?php echo $row['puname'];?></a></td>
                                    	<td><?php echo $row['mphone'];?><a href="tel:<?php echo $row['mphone'];?>"><i class="fa fa-fw fa-phone"></i></a></td>
                                    	<td><?php echo $row['chengji'];?></td>
                                    	<td><?php echo $row['ptype'];?></td>
                                    	<td><?php echo _getAgeByIdcard($row['idcard']);?></td>
                                    	<td><?php echo $row['idcard'];?></td>
                                    	<td><?php echo $row['workunit'];?></td>
                                    	<td><?php echo $row['beizhu'];?></td>
                                    	<td><a href="pxy_bm/type/updshow/puid/<?php echo $row['id'];?>">修改</a></td>
                                    </tr>
                                	<?php 
                                	}
                                	?>
                                </tbody>
                            </table>
                        </div>
                        <!-- /.panel-body -->
                    </div>
                    <!-- /.panel -->
                </div>
                <!-- /.col-lg-12 -->
            </div>
            <!-- /.row -->
             </div>
        </div>
        <!-- /#page-wrapper -->
        <!-- DataTables JavaScript -->
<?php require_once 'bottom.php';?>
    <script src="sb2/vendor/datatables/js/jquery.dataTables.js"></script>
    <script src="sb2/vendor/datatables-plugins/dataTables.bootstrap.min.js"></script>
    <script src="sb2/vendor/datatables-responsive/dataTables.responsive.js"></script>
    <script>
	
	$("#uppic").xxfile({
		url:"pxy_list",
		accept:".jpg",
		multiple:true,
		data:{
			type:"uppic"
		}
	});
	
	$("#upchengji").xxfile({
		url:"pxy_list",
		accept:".xls",
		data:{
			type:"upchengji",
			pid:{{$pid}}
		}
	});
	
    $(document).ready(function() {
        $('#dataTables-example').DataTable({
            responsive: true,
            "aaSorting": [[ 0, "desc" ]],
            "aLengthMenu": [ 200, 100, 50, 10 ]
        });
        
        $("#add").click(function(){
            var realname=$("#realname").val();
            var mphone=$("#mphone").val();
            var zuoji=$("#zuoji").val();
            var zhiwu=$("#zhiwu").val();
			$.xconfirm("确定添加么？",function(data){
				if(data){
					$.xloading(1);
					$.post("usermanage",{type:'add',realname:realname,mphone:mphone,zuoji:zuoji,zhiwu:zhiwu},function(data1){
						if(data1==0){
							$.xloading(0);
							$.xalert("添加失败");
						}else{
							window.location.reload();
						}
					});
				}
			});
        });
    });
    
    function del(id){
		$.xconfirm("删除后无法恢复，确定要删除此条记录么？",function(data){
 			if(data){
				$.xloading(1);
				$.post("usermanage",{type:'del',id:id},function(data1){
					if(data1==0){
						$.xloading(0);
						$.xalert("删除失败");
					}else{
						window.location.reload();
					}
				}); 
			} 
		});
    }
    
    </script>